package com.yao.spider.shanghai.dao;

import com.yao.spider.shanghai.bean.FastMail;
import com.yao.spider.shanghai.mapper.FastMailMapper;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class FastMailDaoImpl implements FastMailDao {
    public int insert(FastMail personInfo, SqlSession session) {
        FastMailMapper mapper = session.getMapper(FastMailMapper.class);
        mapper.insert(personInfo);
        session.commit();
        return 1;
    }

    public int batchInsert(List<FastMail> list, SqlSession session) {
        FastMailMapper mapper = session.getMapper(FastMailMapper.class);
        mapper.insertBatch(list);
        session.commit();
        return 1;
    }
}
